<div class="container"> 
	<div class="row"> 
		<div class="panel panel-info">
			<div class="panel-heading">
				<div class="panel-title">POP Email Account</div>
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-md-12">
						<div class="well">
							<h3>Purchase 1 POP Email Account</h3>
							<hr style="background:skyblue;height:1px;">
							<div class="row">
								<div class="col-md-12" >
									<h4>Select a domain name to use with this service</h4>
									<form class="form-horizontal" role="form" action="<?=base_url('users/popemail_purchase')?>" method="post">
										<div class="form-group">
											<label for="inputEmail3" class="col-sm-2">Domain Name * </label>
											<div class="col-sm-6">
												<input class="form-control" name="domainname" id="domainname" placeholder="Please enter domain" onkeyup="CheckDomainInput()"/>
											</div>
										</div>
										
										<div class="form-group">
											<div class="col-sm-offset-2 col-sm-10">
											  <button type="submit" class="btn btn-warning" id="dnsbtn" disabled="disabled">Continue</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>	
			</div>
		</div>
	</div>
</div>
<script>
function CheckDomainInput()
{
	var inputSingle = $("#domainname").val();
	//var inputSingleAuthCode = $("#AuthInfo1").val();
	var activateButton = false;
	if(inputSingle !="")
	{
		if (inputSingle.indexOf(".") != -1) 
		{
			var inputArray = inputSingle.split(".");
			localTLD = inputArray[1];
			//alert(localTLD);
			if (localTLD != "") 
			{			
				activateButton = true;
			}
		}
		else
		{
			activateButton = false;
		}
		
	}
	else
	{	
		activateButton = false;
	}
	if (activateButton) {
		// Activate submit button
		$("#dnsbtn").removeAttr("disabled");
	} else {
		// Deactivate submit button
		$("#dnsbtn").attr("disabled", "disabled");
	}
}
</script>
